//
// Created by yanhai on 2021/11/4.
//

#pragma once

#include <functional>

class defer {
public:
    explicit defer(const std::function<void(void)> &func) : m_p(func) {}

    ~defer() { m_p(); }

private:
    const std::function<void(void)> &m_p;
};

